<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://gson.cn/fn" prefix="el"%>
	
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="easyui-layout" fit="true">
	<div data-options="region:'north'" border="false"
		style="height: 50px; padding: 12px; overflow: hidden;">
		<form id="timuForm">
			所属阶段：
			 <select id="phase" style="height: 24px; border-radius: 5px; border-color: dodgerblue;" onchange="move(this.value)">
						<option value="0">-请选择课程阶段-</option>
					<c:forEach items="${phase }" var="x">
						<option value="${x.phaseId }">${x.phaseName }</option>
					</c:forEach>
			</select>
			 所属章节： 
			 <select id="chapter" style="height: 24px; border-radius: 5px; border-color: dodgerblue;">
			
			</select>
			题目类型： <select id="titleType"
				style="height: 24px; border-radius: 5px; border-color: dodgerblue;">
				<option value="">-请选择-</option>
				<option value="选择题">选择题</option>
				<option value="判断题">判断题</option>
				<option value="代码题">代码题</option>
			</select>&nbsp;&nbsp;&nbsp; <a id="titleSearch" iconCls="icon-search"
				class="easyui-linkbutton">检索</a> <a id="titleReset"
				onclick="return confirm('已重置')" iconCls="icon-reload"
				class="easyui-linkbutton">重置</a>
		</form>
	</div>
	<div data-options="region:'center'" border="false">
		<table id="TiMuGrid"></table>
	</div>
</div>
<div id="timuGridAction" style="display: none;">
		
			<c:if test="${el:contains(keys,'timu:edit') }">
				<a class="ctr edit">编辑</a>
			</c:if>
			<c:if test="${el:contains(keys,'timu:delete') }">
		<a class="ctr delete">删除</a>
		</c:if>
	</div> 
<div id="timuGridToolbar" style="display: none;">
		
			<c:if test="${el:contains(keys,'timu:create') }">
				<a class="easyui-linkbutton ctr create" iconCls="icon-add" plain="true">添加</a>
			</c:if>
</div> 
<script>
	function move(obj) {
		var s1 = document.getElementById("phase");
		var s2 = document.getElementById("chapter");
		var id=obj;
		 var optionString = "<option grade=\'请选择章节名称\' selected = \'selected\'>--请选择章节名称--</option>";
		 $.get("jiaoxue/neirong/" + id, function(rs) {
				if (rs.success) {
					var data=rs.message;
					for (var i = 0; i < data.length; i++) {
						 optionString +="<option grade=\""+data[i].chapterName+"\" value=\""+data[i].chapterName+"\"";  
	                      optionString += ">"+data[i].chapterName+"</option>";  //动态添加数据  
					}
					 $("select[id=chapter]").empty();
					 $("select[id=chapter]").append(optionString);
				}else{
					$.message.alert("提示错误！")
				}
			});
	}
</script>
<script src="public/js/jx-timu.js"></script>
